package com.yang.server.order;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * 模拟订单服务启动类
 *
 * @Author: Mu_YI
 * @Date: 2019/6/4 22:58
 * @Version 1.0
 */

@SpringBootApplication
@EnableEurekaClient
public class OrderServerApp {

    public static void main(String[] args) {
        SpringApplication.run(OrderServerApp.class, args);
    }

    /**
     * 处理RestTemplate 找不到的原因;将其注入到Spring容器中
     * @return
     */
    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

}
